<%@page contentType="text/html" pageEncoding="iso-8859-1"%>
<?xml version="1.0" encoding="ISO-8859-1"?>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="layout" uri="/WEB-INF/tlds/layout.tld" %>

<jsp:useBean id="status" scope="request" class="java.lang.String"/>
<jsp:useBean id="resultadoBusca" scope="request" class="avaliacao.DTO.DTOAvaliador"/>
<jsp:useBean id="avaliador" scope="session" class="avaliacao.DTO.DTOAvaliador"/>

<layout:head>
    <%-- Insert extra scripts and styles here --%>
</layout:head>

<body>
                <table>
                    <tr>
                        <td colspan="2" align="center">
                            <u><h1>Cadastro de Avaliador</h1></u>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <br>
                            Login:
                        </td>
                        <td align="left">
                            <br>
                             <c:if test="${resultadoBusca.ID == -1}">
                                <input name="login" type="text" size="30" maxlength="20"/>*
                             </c:if>
                             <c:if test="${resultadoBusca.ID != -1}">
                                 <input name="login" type="text" size="30" maxlength="20" readonly="true" value="${resultadoBusca.login}"/>*
                             </c:if>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <br>
                            Nome:
                        </td>
                        <td align="left">
                            <br>
                             <c:if test="${resultadoBusca.ID == -1}">
                                <input name="nome" type="text" size="80" maxlength="60"/>*
                             </c:if>
                             <c:if test="${resultadoBusca.ID != -1}">
                                 <input name="nome" type="text" size="80" maxlength="60" value="${resultadoBusca.nome}"/>*
                             </c:if>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <br>
                           Email:
                        </td>
                        <td align="left">
                            <br>
                             <c:if test="${resultadoBusca.ID == -1}">
                                <input name="email" type="text" size="80" maxlength="50"/>*
                             </c:if>
                             <c:if test="${resultadoBusca.ID != -1}">
                                 <input name="email" type="text" size="80" maxlength="50" value="${resultadoBusca.email}"/>*
                             </c:if>
                        </td>
                    </tr>
                    <c:if test="${avaliador.grupo == 'admin'}">
                        <tr>
                            <td>
                                <br>
                                Permiss&atilde;o:
                            </td>
                            <td align="left">
                                <br>
                                <select name="grupo"  >
                                    <option value="admin">Administrador</option>
                                    <option value="avaliador" <c:if test="${resultadoBusca.grupo == 'avaliador'}">selected </c:if>>Avaliador</option>
                                </select>
                            </td>
                        </tr>
                    </c:if>
                    <tr>
                        <td align="right" colspan="2">
                            <font size="-1" color="red">Os campos assinalados com * s&atilde;o obrigat&oacute;rios.</font>
                            <br>
                            <br>
                            <input name="submeter" type="submit" value="Salvar" onclick="submitForm('submeterFormAvaliador')"/>
                            <br>
                            <br>
                            <div id="status">
                                <%=status%>
                            </div>
                            <br>
                            <br>
                            <br>
                            <br>
                            <br>
                            <br>
                            <br>
                            <br>
                            <br>
                            <br>
                        </td>
                    </tr>
                </table>
</body>